package com.suray.basic.wcs.plc.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.suray.basic.wcs.plc.entity.PlcDeviceDB;
import com.suray.basic.wcs.plc.enums.PlcDeviceType;
import com.suray.basic.wcs.plc.pojo.*;
import com.suray.basic.wcs.plc.pojo.oper.HandleAutoHoistOper;
import com.suray.basic.wcs.plc.pojo.oper.HandleScanOper;
import com.suray.basic.wcs.plc.pojo.oper.HandleShapeConveyor;
import com.suray.basic.wcs.plc.pojo.oper.HandleToothHoistOper;
import com.suray.basic.wcs.plc.pojo.oper.single.AutoHoistOper;
import com.suray.basic.wcs.plc.pojo.oper.single.FoldingOper;
import com.suray.basic.wcs.plc.pojo.oper.single.ToothHoistOper;
import com.suray.basic.wcs.utils.Coord;


import java.io.IOException;
import java.util.List;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author cooper
 * @since 2019-06-26
 */
public interface IPlcDeviceDBService extends IService<PlcDeviceDB> {

    /**
     * 更新设备任务
     * @param deviceId
     * @param taskNo
     * @return
     */
    int updateDeviceTask(long deviceId, int taskNo);
    /**
     * 清除设备任务
     * @param deviceId
     * @return
     */
    int clearDeviceTask(long deviceId);

    List<PlcDeviceDB> findByType(PlcDeviceType deviceDB);

    List<PlcDeviceDB> deletePlcDevice(List<Integer> deviceIdList);

    List<PlcDeviceDB> getPlcByType(int deviceType);

    boolean checkPlcDeviceName(String plcName, Integer plcId);

    public int updatePlcDeviceByPlcId(PlcDeviceDB plcDeviceDB, String status);

    boolean checkPlcDeviceName(PlcDeviceDB plcdevicedb);

    int changePlc(PlcDeviceDB plcdevicedb);

    boolean addPlcDevice(PlcDeviceDB plcdevicedb);

    PlcDeviceDB getPlcDevById(Integer id);

    List<PlcDeviceDB> queryPlcDevices();

    List<PlcDeviceDB> queryPlcConvDevices();

    List<PlcDeviceDB> queryPlcDevices(List<Integer> deviceType);

    boolean checkPlcDeviceNo(PlcDeviceDB plcdevicedb);

    PlcDeviceDB queryPlcdevByDeviceId(Integer deviceId);

    PlcDeviceDB getSystemByPlcId(Integer plcId);

    List<PlcDeviceDB> queryLiftList();

    List<PlcDeviceDB> selectDevsByCondtion(PlcDeviceDB plcdeviceDB);

    int deletePlcDevByIds(Long[] deviceId);

    PlcDeviceDB selectPlcDevById(Long deviceId);

    HandleDishTemp plcDishDeviceR(String deviceName);

    HandleChainStatus plcChainStationDeviceR(String deviceName);

    HandleShape plcShapeDeviceR(String deviceName);

    HandleWeight plcWeightDeviceR(String deviceName);

    HandleShapeConveyor plcShapeConveyorDevice(Integer deviceId);

    HandleScanOper plcScanDevice(Integer deviceId);

    ScannerHandleBean readBarCode(String deviceName);

    HandleTransplanter plcTransPlanterDeviceR(String deviceName);

    HandleAutoDoor plcAutoDoorDevice(String deviceName);

    HandleAutoDoor2 plcAutoDoorDevice2(String deviceName);

    HandleAutoHoistOper plcAutoHoistDevice(Integer deviceId);

    void autoHoistClearError(AutoHoistOper autoHoistOper) throws IOException;

    void toothHoistLiftAutoSpeed(ToothHoistOper toothHoistOper, Integer speed) throws IOException;

    void toothHoistLiftAutoAcc(ToothHoistOper toothHoistOper, Integer time) throws IOException;

    void toothHoistLiftAutoDec(ToothHoistOper toothHoistOper, Integer time) throws IOException;

    void toothHoistLiftManualSpeed(ToothHoistOper toothHoistOper, Integer speed) throws IOException;

    void toothHoistLiftManualAcc(ToothHoistOper toothHoistOper, Integer time) throws IOException;

    void toothHoistLiftManualDec(ToothHoistOper toothHoistOper, Integer time) throws IOException;

    void toothHoistConveyorAutoSpeed(ToothHoistOper toothHoistOper, Integer speed) throws IOException;

    void toothHoistConveyorAutoAcc(ToothHoistOper toothHoistOper, Integer time) throws IOException;

    void toothHoistConveyorAutoDec(ToothHoistOper toothHoistOper, Integer time) throws IOException;

    void toothHoistConveyorManualSpeed(ToothHoistOper toothHoistOper, Integer speed) throws IOException;

    void toothHoistConveyorManualAcc(ToothHoistOper toothHoistOper, Integer time) throws IOException;

    void toothHoistConveyorManualDec(ToothHoistOper toothHoistOper, Integer time) throws IOException;

    void toothHoistRiseMovement(ToothHoistOper toothHoistOper) throws IOException;

    void toothHoistDropMovement(ToothHoistOper toothHoistOper) throws IOException;

    void toothHoistClearError(ToothHoistOper toothHoistOper) throws IOException;

    void platformRise(ToothHoistOper toothHoistOper) throws IOException;

    void platformDrop(ToothHoistOper toothHoistOper) throws IOException;

    void platformToothForwardIn(ToothHoistOper toothHoistOper) throws IOException;

    void platformToothForwardOut(ToothHoistOper toothHoistOper) throws IOException;

    void platformToothReverseIn(ToothHoistOper toothHoistOper) throws IOException;

    void platformToothReverseOut(ToothHoistOper toothHoistOper) throws IOException;

    HandleSystem plcSystemDevice(String deviceName);

    List<PlcDeviceDB> getPlcByLocation(Coord coord);

    PlcDeviceDB getLifterDeviceDB(int plcDeviceType, Coord coord);

    public List<PlcDeviceDB> selectPlcDevByPlcId(Integer plcId);

    HandleTransP plcTransPDevice(Integer deviceId);

    HandleWeightOper plcWeightDevice(Integer deviceId);

    HandleLifterSystem lifterSystemDevice(Integer deviceId);

    HandleLifterStation lifterStationDevice(Integer deviceId);

    void foldingMachineAutoSpeed(FoldingOper foldingOper, Integer speed) throws IOException;

    void foldingMachineAutoAcc(FoldingOper foldingOper, Integer time) throws IOException;

    void foldingMachineAutoDec(FoldingOper foldingOper, Integer time) throws IOException;

    void foldingMachineManualSpeed(FoldingOper foldingOper, Integer speed) throws IOException;

    void foldingMachineManualAcc(FoldingOper foldingOper, Integer time) throws IOException;

    void foldingMachineManualDec(FoldingOper foldingOper, Integer time) throws IOException;

    void foldingMachineManualUp(FoldingOper foldingOper) throws IOException;

    void foldingMachineManualDown(FoldingOper foldingOper) throws IOException;

    void foldingMachineReachInPlace(FoldingOper foldingOper) throws IOException;

    void foldingMachineShrinkInPlace(FoldingOper foldingOper) throws IOException;

    void foldingMachineDismantlePallet(FoldingOper foldingOper) throws IOException;

    void foldingMachineFoldPallet(FoldingOper foldingOper) throws IOException;

    void foldingMachineDismantleAllPallet(FoldingOper foldingOper) throws IOException;

    void foldingMachineFoldAllPallet(FoldingOper foldingOper) throws IOException;

    void setClearError(FoldingOper foldingOper) throws IOException;

}
